/**
 * 获取唯一id(6位)
 */
function getUId() {
    return parseInt(Math.random() * 1000000);
}


var userAgent = navigator.userAgent.toLowerCase();

function browser() {
    return {
        version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
        safari: /webkit/.test(userAgent),
        opera: /opera/.test(userAgent),
        msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
        mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
    };
}

module.exports = {
    getUId,
    browser,
}